---
layout: base_cn
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<div class="row">
{% if page.sub-nav-group %}
{% comment %}
The plain layout with a sub navigation.

- This is activated via the 'sub-nav-group' field in the preemble.
- All pages of this sub nav group will be displayed in the sub navigation:
  * Each element without a 'sub-nav-parent' field will be displayed on the 1st level, where the position is defined via 'sub-nav-pos'.
  * If the page should be displayed as a child element, it needs to specify a 'sub-nav-parent' field, which matches the 'sub-nav-id' of its parent. The parent only needs to specify this if it expects child nodes.
{% endcomment %}
  <!-- Sub Navigation -->
  <div class="col-sm-3">
    <ul id="sub-nav">
      {% comment %} Get all pages belonging to this group sorted by their position {% endcomment %}
      {% assign group = (site.pages | where: "sub-nav-group" , page.sub-nav-group | where: "sub-nav-parent" , nil | sort: "sub-nav-pos") %}
      {% for group_page in group %}
        {% if group_page.sub-nav-id  %}
        {% assign sub_group = (site.pages | where: "sub-nav-group" , page.sub-nav-group | where: "sub-nav-parent" , group_page.sub-nav-id | sort: "sub-nav-pos") %}
        {% else %}
        {% assign sub_group = nil %}
        {% endif %}
        <li><a href="{{ site.baseurl }}{{ group_page.url }}" class="{% if page.url contains group_page.url %}active{% endif %}">{% if group_page.sub-nav-title %}{{ group_page.sub-nav-title }}{% else %}{{ group_page.title }}{% endif %}</a>
          {% if sub_group and sub_group.size() > 0 %}
          <ul>
            {% for sub_group_page in sub_group %}
              <li><a href="{{ site.baseurl }}{{ sub_group_page.url }}" class="{% if page.url contains sub_group_page.url or (sub_group_page.sub-nav-id and page.sub-nav-parent and sub_group_page.sub-nav-id == page.sub-nav-parent) %}active{% endif %}">{% if sub_group_page.sub-nav-title %}{{ sub_group_page.sub-nav-title }}{% else %}{{ sub_group_page.title }}{% endif %}</a></li>
            {% endfor %}
          </ul>
          {% endif %}
        </li>
      {% endfor %}
    </ul>
  </div>
  <!-- Main -->
  <div class="col-sm-9">
    <!-- Top anchor -->
    <a href="#top"></a>

    <div class="text">
      <!-- Main heading -->
      <h1>{{ page.title }}</h1>

      <!-- Content -->
      {{ content }}      
      <div class="footer">
      Google Groups: <a target="_blank" href="https://groups.google.com/forum/#!forum/jstorm-user">jstorm-user</a>, QQ Groups: 228374502
      </p>
 
      发现错误？想参与编辑？
      <a href="https://github.com/alibaba/jstorm/edit/master/docs/jstorm-doc/{{ page.path }}" target="_blank">
        在 Github 上编辑此页！
      </a>
  </div>
    </div>
  </div>
{% else %}
{% comment %}
The plain layout without a sub navigation (only text).
{% endcomment %}  
  {% if page.url == "/index_cn.html" %}
    <div class="row">
		<div class="col-sm-10 col-sm-offset-1">
			{{ content }}  
		</div>
    </div>
  {% else %}
  <div class="col-md-8 col-md-offset-2 text">
    <h1>{{ page.title }}{% if page.is_beta %} <span class="beta">Beta</span>{% endif %}</h1>
	{{ content }}
  <div class="footer">
      Google Groups: <a target="_blank" href="https://groups.google.com/forum/#!forum/jstorm-user">jstorm-user</a>, QQ Groups: 228374502
      </p>
 
      发现错误？想参与编辑？
      <a href="https://github.com/alibaba/jstorm/edit/master/docs/jstorm-doc/{{ page.path }}" target="_blank">
        在 Github 上编辑此页！
      </a>
  </div>
  </div>
  {% endif %}
{% endif %}
  {% if page.comment == true %}
  <!-- Removed until Robert complains... ;) -->
  <div class="col-sm-8 col-sm-offset-2">
    <!-- Disqus thread and some vertical offset -->
    <div style="margin-top: 50px; margin-bottom: 50px" id="disqus_thread"></div>
  </div>
  {% endif %}
</div>
